<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>

</head>
<body>
<h1>hello world</h1>
<div id="app">
    <h1>Hello App!</h1>
    <p>
        <router-link to="/foo?id=1">Go to Foo</router-link>
        <router-link to="/bar?id=2">Go to Bar</router-link>
        <router-link to="/cde?id=3">Go to Bar</router-link>
        <router-link to="/fgh?id=4">Go to Bar</router-link>
        <router-link :to="{ path: '/abc'}" replace>66666666</router-link>
    </p>
    <router-view></router-view>
</div>
<script type="text/javascript">
    const Foo = { template: '<div>foo</div>' };
    const Bar = { template: '<div>bar</div>' };
    const Cde = { template: '<div>cde</div>' };
    const Fgh = { template: '<div>fgh</div>' };
    const User = {
        template: '<div>User {{ $route.params.id }}</div>'
    }
    const routes = [
        { path: '/foo', component: Foo },
        { path: '/bar', component: Bar },
        { path: '/cde', component: Cde },
        { path: '/fgh', component: Fgh },
        { path: '/user/:id', component: User }
    ];
    const router = new VueRouter({
        routes: routes
    });
    const app = new Vue({
        router
    }).$mount('#app');
</script>
</body>
</html>